package com.mengniu.commerce.admin.api;


import com.mengniu.commerce.admin.api.domain.bo.RemoteSocialBo;
import com.mengniu.commerce.admin.api.domain.vo.RemoteSocialVo;
import com.mengniu.commerce.admin.api.factory.RemoteSocialFallbackFactory;
import com.mengniu.commerce.common.core.constant.ServiceNameConstants;
import com.mengniu.commerce.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: dgyu-398305246@qq.com
 * @createTime: 2023年12月03 21:31:58
 * @description: 社会化关系服务
 */
@FeignClient(contextId = "remoteSocialService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSocialFallbackFactory.class)
public interface RemoteSocialService {

    /**
     * 根据 authId 查询用户信息
     */
    @GetMapping("/social/{authId}")
    R<List<RemoteSocialVo>> selectByAuthId(@PathVariable("authId")String authId);

    /**
     * 保存社会化关系
     */
    @PostMapping("/social/save")
    R<Void> insertByBo(@RequestBody RemoteSocialBo bo);

    /**
     * 更新社会化关系
     */
    @PostMapping("/social/update")
    R<Void> updateByBo(@RequestBody RemoteSocialBo bo);

    /**
     * 删除社会化关系
     */
    @DeleteMapping("/social/unlock/{socialId}")
    R<Boolean> unlock(@PathVariable("socialId") String socialId);

}
